home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / surfboard / PHP-HOWTO < prev    next >
Text File  |  2002-10-23  |  1KB  |  35 lines

  1.             How to use PHP with Surfboard
  2.     Basically, this is done by compiling PHP as a CGI script, putting
  3. on a wrapper (I haven't figured out how to make php NPH), and adding the
  4. appropriate entries to the MIME configuration file for .php files.
  5.  
  6.     (1) Compiling PHP as a CGI script
  7.         * Get the source from www.php.net
  8.         * Just compile it ('make') - don't set any other options
  9.         * Copy the resulting binary (called just 'php') to
  10.           somewhere (here, I'll assume /usr/local/bin, but it
  11.           could be anywhere).
  12.  
  13.     (2) Putting on the wrapper
  14.         * A shell script like this should do the trick:
  15.  
  16. #!/bin/sh
  17. echo "HTTP/1.1 200 OK"
  18. echo "Connection: close"
  19. /usr/local/bin/php $1
  20.  
  21.           Make sure to refer to the php binary with an ABSOLUTE
  22.           path - the current directory will be that containing the
  23.           script, not the interpreter.
  24.  
  25.     (3) Telling Surfboard what to do with .php files
  26.         * Add something like the following to your MIME
  27.           configuration file (/etc/surfboard/mime.conf unless you
  28.           have specified something else in the main config file):
  29.  
  30. php    application/x-php    /usr/local/bin/php-wrapper
  31. php3    application/x-php    /usr/local/bin/php-wrapper
  32.  
  33.  
  34. Tradaa! One successful PHP installation.
  35.